import http from '../../utils/http'
import {LoginForm, LoginResult} from "./types/login.dto.ts";
import {ApiResponse} from "../../utils/ApiResponse";

// 登录
export const userLogin = (data: LoginForm): Promise<LoginResult> => {
    return http.post('/sysUser/login', data)
}

// 获取验证码
export const getChapter = (): Promise<string> => {
    return http.get('/sysUser/code',{ responseType: 'blob' })
}

// 注册
export const userRegister = (data: LoginForm): Promise<ApiResponse<Object>> => {
    return http.post('/sysUser/register', data)
}